package com.spring.sunflower.dialog;

import android.app.Activity;
import android.content.Intent;
import android.os.Handler;
import android.widget.TextView;

import com.lxj.xpopup.XPopup;
import com.lxj.xpopup.enums.PopupAnimation;
import com.spring.sunflower.event.LuckyMatchEvent;

/**
 * Created by Kevin on 2021/11/17<br/>
 * <p>
 * Describe:<br/>
 */
public class LuckyMatchDialogUtils {
    private static LuckyMatchDialogUtils mInstance;

    public static LuckyMatchDialogUtils getInstance() {
        if (mInstance == null) {
            synchronized (LuckyMatchDialogUtils.class) {
                if (mInstance == null) {
                    mInstance = new LuckyMatchDialogUtils();
                }
            }
        }
        return mInstance;
    }

    public void show(Activity context, LuckyMatchEvent event,String type) {
        LuckyMatchDialog dialog = new LuckyMatchDialog(context, event,type);
//        taskFinishDialog.setOnTaskFinishListener(new TaskFinishDialog.OnTaskFinishListener() {
//            @Override
//            public void onCrateView() {
//                TextView tvAward = taskFinishDialog.findViewById(R.id.tvAward);
//                tvAward.setText(award);
//            }
//
//            @Override
//            public void onMoreClick() {
//                context.startActivity(new Intent(context, TaskActivity.class));
//            }
//        });
        new XPopup.Builder(context)
                .isRequestFocus(false)
                .dismissOnTouchOutside(false)
                .offsetY(200)
                .popupAnimation(PopupAnimation.TranslateAlphaFromTop)
                .autoDismiss(false)
                .asCustom(dialog)
                .show();
    }
}